package com.briup.jdk8.day03;

import com.briup.corejava.day11.pojo.Student;

import java.util.Comparator;
import java.util.stream.Stream;

/**
 * 中间操作
 * 排序、映射、过滤、去重。。。
 */
public class Test3 {
    public static void main(String[] args) {
        Stream<String> stream = Stream.of("java","test","hello","test","world","java","tom","C","javascript");
        stream.map(s -> new Student(s, 0))
                .sorted(Comparator.comparing(Student::getName))
                .limit(3)
                .distinct()
                .forEach(System.out::println);
    }
}
